package com.engine.demo.dao;


/**
 *
 * 用户自定义设置 dao AndyZhang 2018-6-22
 * @version 1.0
 */
public class DemoDao {

	public static String table="ECOLOGY_DEMO";

	
	/**
	 * 获取查询数据源信息sql
	 * @return
	 */
	public static String getAll(){
		return " select * from ECOLOGY_DEMO  ";
	}

	/**
	 * 获取相关记录数
	 * @return
	 */
	public static String getCount(){
		return "select count(1) from ECOLOGY_DEMO ";
	}



	/**
	 * 通过id获取查询数据源信息sql
	 * @return
	 */
	public static String getOne(){
		 return "select * from ECOLOGY_DEMO where id =?";
	}

	/**
	 * 新增
	 * @return
	 */
	public static String getInsert(){
		StringBuilder sb = new StringBuilder();

		sb.append("insert into ECOLOGY_DEMO (CORP_ID,OA_NAME,OA_ADDRESS,");
		sb.append("EM_NAME,EM_URL,STATUS,CREATERID,CREATEDATE,");
		sb.append("CREATETIME,MODIFYDATE,MODIFYTIME,REMARK) values(  ?,?,?,?,?,   ?,?,?,?,?,   ?,?) ");
		
		return sb.toString();
	}
	
	/**
	 * 修改
	 * @return
	 */
	public static String getUpdate(){
		StringBuilder sb = new StringBuilder();
		sb.append("update ECOLOGY_DEMO set corp_id=?,oa_name=?,oa_address=?,em_name=?,em_url=?,remark=?,");
		sb.append("MODIFYDATE=?,MODIFYTIME=? where ID=?");

		
		return sb.toString();
	}
	
	/**
	 * 删除
	 * @return
	 */
	public static String getDelete(Object obj){
		String sql ="delete from ECOLOGY_DEMO where id in ("+obj+")";
		
		return sql;
	}
	



}
